<?php

if(!defined("INDEX"))
    die;

if(!check_post('message', 'release_id'))
    throw new HackException();

// ----------------------------------------------------------------------------

$release = Release::getById($_POST['release_id']);

try {

    $release->addComment($_POST['message'], $user->id);

    $smarty->assign('release_id', $release->id);

} catch (Exception $e) {

    $smarty->assign('errors', array($e->getMessage()));
}